<?php
namespace Home\Controller;
use Think\Controller;
class UserController extends Controller {
	public function getIsPostRequest(){
        return isset($_SERVER['REQUEST_METHOD']) && !strcasecmp($_SERVER['REQUEST_METHOD'],'POST');
	}

    public function getAlluser(){
         $user=M('user');
	   $data=$user->order('uid asc')->select();
	   echo json_encode($data);
    }
     public function getuserById(){
     	if(getIsPostRequest()){
        $uid=$_GET['uid'];
       	}
        else{
        $uid=$_POST['uid'];  
        }
        $user=M('user');
        $data=$user->where("uid=$uid")->select();
        echo json_encode($data);
    }

} 